<style>
    #obj-add {
        padding: 20px 25px 25px 0;
    }
    #obj-add .layui-treeSelect .ztree li a, .ztree li span {
        margin: 0 0 2px 3px !important;
    }
</style>
<div class="layui-fluid" id="obj-add">
    <form class="layui-form" action="" lay-filter="obj-add-form">
                <div class="layui-form-item">
                    <label class="layui-form-label">部门：</label>
                    <div class="layui-input-block">
                        <select name="deptId" id="deptId" >

                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">事项名称：</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">所属部门名称：</label>
                    <div class="layui-input-block">
                        <input type="text" name="deptName" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">办件类型：</label>
                    <div class="layui-input-block">
                        <input type="text" name="bjlx" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">法定期限：</label>
                    <div class="layui-input-block">
                        <input type="text" name="fdqx" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">法定期限说明：</label>
                    <div class="layui-input-block">
                        <input type="text" name="fdqxsm" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">承诺时限：</label>
                    <div class="layui-input-block">
                        <input type="text" name="cnsx" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">承诺时限说明：</label>
                    <div class="layui-input-block">
                        <input type="text" name="cnsxsm" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">纸质申请材料的收取方式：</label>
                    <div class="layui-input-block">
                        <input type="text" name="zzsqclsqfs" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">申请条件说明：</label>
                    <div class="layui-input-block">
                        <input type="text" name="sqtjsm" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否收费：</label>
                    <div class="layui-input-block">
                        <input type="text" name="sfsf" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">办理结果获取方式：</label>
                    <div class="layui-input-block">
                        <input type="text" name="bljghqfs" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">办结结果说明：</label>
                    <div class="layui-input-block">
                        <input type="text" name="bjjgsm" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">办公时间：</label>
                    <div class="layui-input-block">
                        <input type="text" name="bgsj" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">联系电话：</label>
                    <div class="layui-input-block">
                        <input type="text" name="lxdh" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">监督投诉：</label>
                    <div class="layui-input-block">
                        <input type="text" name="jdts" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否人才服务：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="isRcfw" value="1" title="是" checked="">
                        <input type="radio" name="isRcfw" value="0" title="否">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否项目服务：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="isXmfw" value="1" title="是" checked="">
                        <input type="radio" name="isXmfw" value="0" title="否">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否一网通办：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="isYwtb" value="1" title="是" checked="">
                        <input type="radio" name="isYwtb" value="0" title="否">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否公共服务：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="isGgfw" value="1" title="是" checked="">
                        <input type="radio" name="isGgfw" value="0" title="否">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否企业服务：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="isQyfw" value="1" title="是" checked="">
                        <input type="radio" name="isQyfw" value="0" title="否">
                    </div>
                </div>

        <div class="layui-form-item febs-hide">
            <button class="layui-btn" lay-submit="" lay-filter="obj-add-form-submit" id="submit"></button>
            <button type="reset" class="layui-btn" id="reset"></button>
        </div>
    </form>
</div>

<script>
    layui.use(['febs', 'form', 'formSelects', 'validate', 'treeSelect'], function () {
        var $ = layui.$,
            febs = layui.febs,
            layer = layui.layer,
            formSelects = layui.formSelects,
            treeSelect = layui.treeSelect,
            form = layui.form,
            $view = $('#obj-add'),
            validate = layui.validate;

        form.verify(validate);
        form.render();

        formSelects.render();
        $.get(ctx+"halldepart/data",{},function (data) {
            var list=data.data
            var select = document.getElementById('deptId');
            if (list != null || list.size() > 0) {
                for (var c =0;c<list.length;c++) {
                    var option = document.createElement("option");
                    option.setAttribute("value", list[c].id);
                    option.innerText = list[c].deptName;
                    select.appendChild(option)
                }
            }
            layui.form.render("select");
        },"json");

        form.on('submit(obj-add-form-submit)', function (data) {
            febs.post(ctx + 'itemPublic.html', data.field, function () {
                layer.closeAll();
                febs.alert.success('新增成功');
                $('#febs-obj').find('#query').click();
            });
            return false;
        });
    });


</script>